{% extends "pages/overseer/_shell.html" %} {% from "components/macros/layout.html" import page_header %} {% from "components/macros/feedback.html" import empty_state %} {% from "components/macros/player.html" import stage %} {% from "components/macros/table.html" import data_table %} {% from "pages/overseer/_macros.html" import line_link %} {% block title %}Replay - {{ project_name }}{% endblock %} {% block overseer_width %}{{ "workspace" if replay is defined and replay else "document" }}{% endblock %} {# A route of the recent requests, in the tone of its worst answer. #} {% macro _route(group) %}{{ group.route }}{% endmacro %} {# Each request to it, newest first, opening its replay. #} {% macro _requests(group) %}
    {% for kept in group.requests %}{% set url = replay_url(kept.id) %}
  1. {{ kept.path }} {{ kept.status }} {{ kept.ms }} ms {{ kept.hop_count|counted("hop") }}
  2. {% endfor %}
{% endmacro %} {% block overseer_content %} {% if replay is defined %} {# One request a level at a time (overseer_replay.replay), or its hops as a list (overseer_replay.listed). #} {% if replay %} {% set other, other_label = replay_switch %} {# How it was answered, in its tone: a refusal amber, a failure red. #} {% set said %}{{ replay.status }} in {{ replay.ms }} ms, {{ replay.hops|length|counted("hop") }}{{ ", " ~ replay.dropped ~ " more not kept" if replay.dropped }}{% endset %} {% call page_header(replay.method ~ " " ~ replay.path, said) %} {% endcall %} {% if replay_rows is defined %}
    {% for row in replay_rows %}{% set hop = row.hop %}
  1. {{ row.label }}{% if hop.tables %} {{ hop.tables|join(", ") }}{% endif %}{% if hop.error %} failed{% endif %} {% if row.line %}{{ line_link(row.line.path, row.line.line) }}{% endif %} {{ hop.ms }} ms
  2. {% endfor %}
{% else %} {{ stage(replay_steps, replay_scenes) }} {% endif %} {% else %} {% call page_header("Replay") %}{% endcall %}
{{ empty_state("This request is no longer kept", "The server keeps its last " ~ replay_keep ~ " requests, for a day.") }}
{% endif %} {% else %} {# The requests kept (overseer_replay.recent): a row a route, the latest first, opening to each request to it, newest first. #} {% call page_header("Replay", "Pick a request to watch it cross the map, hop by hop, at its real timing") %}{% endcall %} {% if replay_routes %} {{ data_table([ {"key": "route", "label": "Route", "render": _route, "row": True}, {"key": "count", "label": "Requests", "kind": "int", "align": "right"}, {"key": "slowest", "label": "Slowest", "align": "right"}, {"key": "hops", "label": "Hops", "kind": "int", "align": "right"}, ], replay_routes, detail=_requests, flush=False) }} {% else %} {{ empty_state("No requests yet", "Each request the app serves is kept here, its last " ~ replay_keep ~ "; Overseer's own pages are left out.") }} {% endif %} {% endif %} {% endblock %}